package com.wechat.back.utils;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class SensitiveWordRead {
    public static void main(String[] args) {
        List<String> lines = readSensitiveWords();
        System.out.println(lines);
    }
    public static List<String> readSensitiveWords () {
        List<String> lines = new ArrayList<>();
        String fileName = "data/sensitive_word.txt";
        try (InputStream inputStream = SensitiveWordRead.class.getClassLoader().getResourceAsStream(fileName);
             BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
            String line;
            while ((line = reader.readLine()) != null) {
                lines.add(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return lines;
    }
}
